package org.lyh.doc;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.lang.annotation.Documented;

@Document(indexName = "user")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserDoc {
    @Id
    private Long id;
    @Field(type = FieldType.Keyword)//keyword 不分词
    private String name;
    @Field(type = FieldType.Text)//text分词
    private String intro;
}
